import { auditLogAPI, CreateAuditLogPayload } from './api'

export async function recordAuditLog(payload: CreateAuditLogPayload) {
  try {
    await auditLogAPI.create({
      module: '通用模块',
      // operationType 字段不在 CreateAuditLogPayload 类型中，故移除
      // resultStatus: 'success',
      operationType: 'other',
      resultStatus: 'success',
      ...payload,
    })
  } catch (error) {
    console.warn('记录审计日志失败:', error)
  }
}

